#include <iostream>
using namespace std;

int m,n;
short v[8][8]={0};
short f[8]={0};

void logf(){
        cout<<"f: ";
        for(int i=0; i<n; i++){
                cout<<f[i]<<" ";
        }
        cout<<endl;
}

void logv(){
        cout<<"v: ";
        cout<<endl;
        for(int i=0; i<n; i++){
                for(int j=0; j<n; j++){
                        cout<<v[i][j]<<" ";
                }
                cout<<endl;
        }
        cout<<endl;     
}

int dfs(int srcCol){
//        cout<<"start process col "<<srcCol<<endl;
//    logf();
        int subSum = 0, usedNum=0;
        for(int i=0; i<n; i++){
                if(f[i]==1){
                        usedNum++;
                        continue;
                } 
                if(v[i][srcCol]==0) continue;
                                
                f[i]=1;
                subSum += dfs(i);
                f[i]=0;
        }       
        subSum = subSum==0?(usedNum==n?1:0):subSum;
//        cout<<"end process col "<<srcCol<<" (subSum="<<subSum <<" usedNum="<<usedNum<<")"<<endl;
        return subSum;
}


int main(){
  cin>>n>>m;

  int ai,aj;
  for(int i=0;i<m;i++){
        cin>>ai>>aj;
        v[ai-1][aj-1]=1;
        v[aj-1][ai-1]=1;
  }     
  
  f[0]=1;
//  logv();
  int sum=dfs(0);
  cout<<sum;
}
